/*
package lzm.register;

import lzm.factory.ServiceFactory;
import lzm.spring.config.Inteceptor;
import lzm.spring.service.RpcClient;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class BeanRegister implements BeanFactoryAware {

    private BeanFactory beanFactory;

    @PostConstruct
    public void register(){
        AbstractBeanDefinition beanDefinition = BeanDefinitionBuilder.genericBeanDefinition().getBeanDefinition();
        beanDefinition.setBeanClass(ServiceFactory.class);
        beanDefinition.getConstructorArgumentValues().addGenericArgumentValue(RpcClient.class);
        //重点
        BeanDefinitionRegistry registry = (BeanDefinitionRegistry) this.beanFactory;
        registry.registerBeanDefinition("rpcClient", beanDefinition);
    }

    */
/**
     *
     *//*

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        this.beanFactory = beanFactory;
    }

}*/
